<?php if(isset($show_options)){ $open_target = "_self";}else{ $open_target = "_blank"; } ?>
<?php $list = $res->all(); ?>
{volist name="$list" id="vo"}
  <div class="masonry-item col-md-3 col-sm-6">
    <div class="blog-item rounded shadow">
      <a href="{:url('news/read', array('id'=>$vo['id']))}" target="{$open_target}">
        <img src="{$vo.wap_cover_path|get_thumb_src=###,640}" class="img-responsive" alt="{$vo.title}" />
      </a>
      <div class="blog-details">
        {if condition="($vo.is_has_video)"}
          <div class="ribbon-wrapper">
            <div class="ribbon ribbon-danger">Video</div>
          </div>
        {/if}
        <div class="blog-userinfo">
          <h4 class="blog-title">
            <a href="{:url('news/read', array('id'=>$vo['id']))}" target="{$open_target}">
              {$vo.title}
            </a>
            <?php if($vo["status"] == 0): ?>
              <div class="blog-padding">
                草稿
              </div>
            <?php endif; ?>
          </h4>
          <ul class="blog-meta">
            <li>By: <a href="{:url('news/index', array('user_id'=>$vo['user_id']))}">{$vo.user_nickname}</a></li>
            <li>{$vo.update_time|format_show_time=###,'no_second'}</li>
          </ul>
        </div>
        <div class="blog-options">
          <ul class="blog-meta" >
            <?php if(isset($show_options) && $show_options): ?>
              <li>
                <a class="text-primary" href='{:url("news/edit", array("id"=>$vo["id"]))}'>
                  <span class="glyphicon glyphicon-edit"></span>
                  修改
                </a>
              </li>
              <li>
                <a class="text-danger" href="{:url('news/index', array('user_id'=>$vo['user_id']))}" onclick="alert_del_article('{:url("delete", array("id" => $vo["id"]))}');">
                  <span class="glyphicon glyphicon-trash"></span>
                  删除
                </a>
              </li>
            <?php endif; ?>
          </ul>
        </div>
      </div>
    </div><!-- /.blog-item -->
  </div><!-- col-md-3 -->
{/volist}